package com.todo.strategy.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;
import java.util.Map;
import java.util.stream.Collectors;

/**
 * @author zhangwenxiang
 * @date 2024/3/18 19:40
 * @description
 */
@Getter
@AllArgsConstructor
public enum StrategyTypeEnum {

    TRAVEL_AROUND(1, "TRAVEL_AROUND", "周边游"),
    BUDGET_TOUR(2, "BUDGET_TOUR", "穷游"),
    FAMILY_TRAVEL(3, "FAMILY_TRAVEL", "亲子游"),
    ROAD_TRIP(4, "ROAD_TRIP", "自驾游"),
    CLIMB_FOOT(5, "CLIMB_FOOT", "爬山徒步"),
    RIDE_TRIP(6, "RIDE_TRIP", "骑行"),
    SPECIAL_TRAVEL(7, "SPECIAL_TRAVEL", "特种兵出行"),

    ;

    private static Map<Integer, StrategyTypeEnum> typeMap = Arrays
            .stream(StrategyTypeEnum.values())
            .collect(Collectors.toMap(StrategyTypeEnum::getType, item -> item, (v1, v2) -> v2));

    private int type;
    private String code;
    private String name;


    public static StrategyTypeEnum getByType(Integer type) {
        return typeMap.get(type);
    }
}
